<!DOCTYPE html>


<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Phaser CE Class: Weapon</title>
	<link rel="stylesheet" href="styles/site.phaser.css?2020102114">
</head>

<body>


<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
  	<div class="navbar-header">
  		<a class="navbar-brand" href="index.html">Phaser CE</a>
  		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
  			<span class="icon-bar"></span>
  			<span class="icon-bar"></span>
  			<span class="icon-bar"></span>
      </button>
  	</div>
  	<div class="navbar-collapse collapse" id="topNavigation">
  		<ul class="nav navbar-nav">
  			
  			<li class="dropdown">
  				<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="Phaser.html">Phaser</a></li><li><a href="PhaserGlobal.html">PhaserGlobal</a></li><li><a href="PIXI.html">PIXI</a></li>
  				</ul>
  			</li>
  			
  			<li class="dropdown">
  				<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="CreatureShader.html">CreatureShader</a></li><li><a href="EarCut.html">EarCut</a></li><li><a href="Event.html">Event</a></li><li><a href="EventTarget.html">EventTarget</a></li><li><a href="Phaser.Animation.html">Phaser.Animation</a></li><li><a href="Phaser.AnimationManager.html">Phaser.AnimationManager</a></li><li><a href="Phaser.AnimationParser.html">Phaser.AnimationParser</a></li><li><a href="Phaser.ArraySet.html">Phaser.ArraySet</a></li><li><a href="Phaser.ArrayUtils.html">Phaser.ArrayUtils</a></li><li><a href="Phaser.AudioSprite.html">Phaser.AudioSprite</a></li><li><a href="Phaser.BitmapData.html">Phaser.BitmapData</a></li><li><a href="Phaser.BitmapText.html">Phaser.BitmapText</a></li><li><a href="Phaser.Bullet.html">Phaser.Bullet</a></li><li><a href="Phaser.Button.html">Phaser.Button</a></li><li><a href="Phaser.Cache.html">Phaser.Cache</a></li><li><a href="Phaser.Camera.html">Phaser.Camera</a></li><li><a href="Phaser.Canvas.html">Phaser.Canvas</a></li><li><a href="Phaser.CanvasPool.html">Phaser.CanvasPool</a></li><li><a href="Phaser.Circle.html">Phaser.Circle</a></li><li><a href="Phaser.Color.html">Phaser.Color</a></li><li><a href="Phaser.Component.Angle.html">Phaser.Component.Angle</a></li><li><a href="Phaser.Component.Animation.html">Phaser.Component.Animation</a></li><li><a href="Phaser.Component.AutoCull.html">Phaser.Component.AutoCull</a></li><li><a href="Phaser.Component.Bounds.html">Phaser.Component.Bounds</a></li><li><a href="Phaser.Component.BringToTop.html">Phaser.Component.BringToTop</a></li><li><a href="Phaser.Component.Core.html">Phaser.Component.Core</a></li><li><a href="Phaser.Component.Crop.html">Phaser.Component.Crop</a></li><li><a href="Phaser.Component.Delta.html">Phaser.Component.Delta</a></li><li><a href="Phaser.Component.Destroy.html">Phaser.Component.Destroy</a></li><li><a href="Phaser.Component.FixedToCamera.html">Phaser.Component.FixedToCamera</a></li><li><a href="Phaser.Component.Health.html">Phaser.Component.Health</a></li><li><a href="Phaser.Component.InCamera.html">Phaser.Component.InCamera</a></li><li><a href="Phaser.Component.InputEnabled.html">Phaser.Component.InputEnabled</a></li><li><a href="Phaser.Component.InWorld.html">Phaser.Component.InWorld</a></li><li><a href="Phaser.Component.LifeSpan.html">Phaser.Component.LifeSpan</a></li><li><a href="Phaser.Component.LoadTexture.html">Phaser.Component.LoadTexture</a></li><li><a href="Phaser.Component.Overlap.html">Phaser.Component.Overlap</a></li><li><a href="Phaser.Component.PhysicsBody.html">Phaser.Component.PhysicsBody</a></li><li><a href="Phaser.Component.Reset.html">Phaser.Component.Reset</a></li><li><a href="Phaser.Component.ScaleMinMax.html">Phaser.Component.ScaleMinMax</a></li><li><a href="Phaser.Component.Smoothed.html">Phaser.Component.Smoothed</a></li><li><a href="Phaser.Create.html">Phaser.Create</a></li><li><a href="Phaser.Creature.html">Phaser.Creature</a></li><li><a href="Phaser.Device.html">Phaser.Device</a></li><li><a href="Phaser.DeviceButton.html">Phaser.DeviceButton</a></li><li><a href="Phaser.DOM.html">Phaser.DOM</a></li><li><a href="Phaser.Easing.html">Phaser.Easing</a></li><li><a href="Phaser.Easing.Back.html">Phaser.Easing.Back</a></li><li><a href="Phaser.Easing.Bounce.html">Phaser.Easing.Bounce</a></li><li><a href="Phaser.Easing.Circular.html">Phaser.Easing.Circular</a></li><li><a href="Phaser.Easing.Cubic.html">Phaser.Easing.Cubic</a></li><li><a href="Phaser.Easing.Elastic.html">Phaser.Easing.Elastic</a></li><li><a href="Phaser.Easing.Exponential.html">Phaser.Easing.Exponential</a></li><li><a href="Phaser.Easing.Linear.html">Phaser.Easing.Linear</a></li><li><a href="Phaser.Easing.Quadratic.html">Phaser.Easing.Quadratic</a></li><li><a href="Phaser.Easing.Quartic.html">Phaser.Easing.Quartic</a></li><li><a href="Phaser.Easing.Quintic.html">Phaser.Easing.Quintic</a></li><li><a href="Phaser.Easing.Sinusoidal.html">Phaser.Easing.Sinusoidal</a></li><li><a href="Phaser.Ellipse.html">Phaser.Ellipse</a></li><li><a href="Phaser.Events.html">Phaser.Events</a></li><li><a href="Phaser.Filter.html">Phaser.Filter</a></li><li><a href="Phaser.FlexGrid.html">Phaser.FlexGrid</a></li><li><a href="Phaser.FlexLayer.html">Phaser.FlexLayer</a></li><li><a href="Phaser.Frame.html">Phaser.Frame</a></li><li><a href="Phaser.FrameData.html">Phaser.FrameData</a></li><li><a href="Phaser.Game.html">Phaser.Game</a></li><li><a href="Phaser.GameObjectCreator.html">Phaser.GameObjectCreator</a></li><li><a href="Phaser.GameObjectFactory.html">Phaser.GameObjectFactory</a></li><li><a href="Phaser.Gamepad.html">Phaser.Gamepad</a></li><li><a href="Phaser.Graphics.html">Phaser.Graphics</a></li><li><a href="Phaser.GraphicsData.html">Phaser.GraphicsData</a></li><li><a href="Phaser.Group.html">Phaser.Group</a></li><li><a href="Phaser.Hermite.html">Phaser.Hermite</a></li><li><a href="Phaser.Image.html">Phaser.Image</a></li><li><a href="Phaser.ImageCollection.html">Phaser.ImageCollection</a></li><li><a href="Phaser.Input.html">Phaser.Input</a></li><li><a href="Phaser.InputHandler.html">Phaser.InputHandler</a></li><li><a href="Phaser.Key.html">Phaser.Key</a></li><li><a href="Phaser.Keyboard.html">Phaser.Keyboard</a></li><li><a href="Phaser.KeyCode.html">Phaser.KeyCode</a></li><li><a href="Phaser.Line.html">Phaser.Line</a></li><li><a href="Phaser.LinkedList.html">Phaser.LinkedList</a></li><li><a href="Phaser.Loader.html">Phaser.Loader</a></li><li><a href="Phaser.LoaderParser.html">Phaser.LoaderParser</a></li><li><a href="Phaser.Math.html">Phaser.Math</a></li><li><a href="Phaser.Matrix.html">Phaser.Matrix</a></li><li><a href="Phaser.Mouse.html">Phaser.Mouse</a></li><li><a href="Phaser.MouseWheel.html">Phaser.MouseWheel</a></li><li><a href="Phaser.MSPointer.html">Phaser.MSPointer</a></li><li><a href="Phaser.Net.html">Phaser.Net</a></li><li><a href="Phaser.Particle.html">Phaser.Particle</a></li><li><a href="Phaser.Particles.html">Phaser.Particles</a></li><li><a href="Phaser.Particles.Arcade.html">Phaser.Particles.Arcade</a></li><li><a href="Phaser.Particles.Arcade.Emitter.html">Phaser.Particles.Arcade.Emitter</a></li><li><a href="Phaser.Path.html">Phaser.Path</a></li><li><a href="Phaser.PathFollower.html">Phaser.PathFollower</a></li><li><a href="Phaser.PathPoint.html">Phaser.PathPoint</a></li><li><a href="Phaser.Physics.html">Phaser.Physics</a></li><li><a href="Phaser.Physics.Arcade.html">Phaser.Physics.Arcade</a></li><li><a href="Phaser.Physics.Arcade.Body.html">Phaser.Physics.Arcade.Body</a></li><li><a href="Phaser.Physics.Arcade.TilemapCollision.html">Phaser.Physics.Arcade.TilemapCollision</a></li><li><a href="Phaser.Physics.Ninja.html">Phaser.Physics.Ninja</a></li><li><a href="Phaser.Physics.Ninja.AABB.html">Phaser.Physics.Ninja.AABB</a></li><li><a href="Phaser.Physics.Ninja.Body.html">Phaser.Physics.Ninja.Body</a></li><li><a href="Phaser.Physics.Ninja.Circle.html">Phaser.Physics.Ninja.Circle</a></li><li><a href="Phaser.Physics.Ninja.Tile.html">Phaser.Physics.Ninja.Tile</a></li><li><a href="Phaser.Physics.P2.html">Phaser.Physics.P2</a></li><li><a href="Phaser.Physics.P2.Body.html">Phaser.Physics.P2.Body</a></li><li><a href="Phaser.Physics.P2.BodyDebug.html">Phaser.Physics.P2.BodyDebug</a></li><li><a href="Phaser.Physics.P2.CollisionGroup.html">Phaser.Physics.P2.CollisionGroup</a></li><li><a href="Phaser.Physics.P2.ContactMaterial.html">Phaser.Physics.P2.ContactMaterial</a></li><li><a href="Phaser.Physics.P2.DistanceConstraint.html">Phaser.Physics.P2.DistanceConstraint</a></li><li><a href="Phaser.Physics.P2.FixtureList.html">Phaser.Physics.P2.FixtureList</a></li><li><a href="Phaser.Physics.P2.GearConstraint.html">Phaser.Physics.P2.GearConstraint</a></li><li><a href="Phaser.Physics.P2.InversePointProxy.html">Phaser.Physics.P2.InversePointProxy</a></li><li><a href="Phaser.Physics.P2.LockConstraint.html">Phaser.Physics.P2.LockConstraint</a></li><li><a href="Phaser.Physics.P2.Material.html">Phaser.Physics.P2.Material</a></li><li><a href="Phaser.Physics.P2.PointProxy.html">Phaser.Physics.P2.PointProxy</a></li><li><a href="Phaser.Physics.P2.PrismaticConstraint.html">Phaser.Physics.P2.PrismaticConstraint</a></li><li><a href="Phaser.Physics.P2.RevoluteConstraint.html">Phaser.Physics.P2.RevoluteConstraint</a></li><li><a href="Phaser.Physics.P2.RotationalSpring.html">Phaser.Physics.P2.RotationalSpring</a></li><li><a href="Phaser.Physics.P2.Spring.html">Phaser.Physics.P2.Spring</a></li><li><a href="Phaser.Plugin.html">Phaser.Plugin</a></li><li><a href="Phaser.Plugin.PathManager.html">Phaser.Plugin.PathManager</a></li><li><a href="Phaser.PluginManager.html">Phaser.PluginManager</a></li><li><a href="Phaser.Point.html">Phaser.Point</a></li><li><a href="Phaser.Pointer.html">Phaser.Pointer</a></li><li><a href="Phaser.PointerLock.html">Phaser.PointerLock</a></li><li><a href="Phaser.PointerMode.html">Phaser.PointerMode</a></li><li><a href="Phaser.Polygon.html">Phaser.Polygon</a></li><li><a href="Phaser.QuadTree.html">Phaser.QuadTree</a></li><li><a href="Phaser.RandomDataGenerator.html">Phaser.RandomDataGenerator</a></li><li><a href="Phaser.Rectangle.html">Phaser.Rectangle</a></li><li><a href="Phaser.RenderTexture.html">Phaser.RenderTexture</a></li><li><a href="Phaser.RequestAnimationFrame.html">Phaser.RequestAnimationFrame</a></li><li><a href="Phaser.RetroFont.html">Phaser.RetroFont</a></li><li><a href="Phaser.Rope.html">Phaser.Rope</a></li><li><a href="Phaser.RoundedRectangle.html">Phaser.RoundedRectangle</a></li><li><a href="Phaser.ScaleManager.html">Phaser.ScaleManager</a></li><li><a href="Phaser.Signal.html">Phaser.Signal</a></li><li><a href="Phaser.SignalBinding.html">Phaser.SignalBinding</a></li><li><a href="Phaser.SinglePad.html">Phaser.SinglePad</a></li><li><a href="Phaser.Sound.html">Phaser.Sound</a></li><li><a href="Phaser.SoundManager.html">Phaser.SoundManager</a></li><li><a href="Phaser.Sprite.html">Phaser.Sprite</a></li><li><a href="Phaser.SpriteBatch.html">Phaser.SpriteBatch</a></li><li><a href="Phaser.Stage.html">Phaser.Stage</a></li><li><a href="Phaser.State.html">Phaser.State</a></li><li><a href="Phaser.StateManager.html">Phaser.StateManager</a></li><li><a href="Phaser.Text.html">Phaser.Text</a></li><li><a href="Phaser.Tile.html">Phaser.Tile</a></li><li><a href="Phaser.Tilemap.html">Phaser.Tilemap</a></li><li><a href="Phaser.TilemapLayer.html">Phaser.TilemapLayer</a></li><li><a href="Phaser.TilemapParser.html">Phaser.TilemapParser</a></li><li><a href="Phaser.Tileset.html">Phaser.Tileset</a></li><li><a href="Phaser.TileSprite.html">Phaser.TileSprite</a></li><li><a href="Phaser.Time.html">Phaser.Time</a></li><li><a href="Phaser.Timer.html">Phaser.Timer</a></li><li><a href="Phaser.TimerEvent.html">Phaser.TimerEvent</a></li><li><a href="Phaser.Touch.html">Phaser.Touch</a></li><li><a href="Phaser.Tween.html">Phaser.Tween</a></li><li><a href="Phaser.TweenData.html">Phaser.TweenData</a></li><li><a href="Phaser.TweenManager.html">Phaser.TweenManager</a></li><li><a href="Phaser.Utils.html">Phaser.Utils</a></li><li><a href="Phaser.Utils.Debug.html">Phaser.Utils.Debug</a></li><li><a href="Phaser.Video.html">Phaser.Video</a></li><li><a href="Phaser.Weapon.html">Phaser.Weapon</a></li><li><a href="Phaser.World.html">Phaser.World</a></li><li><a href="PIXI.BaseTexture.html">PIXI.BaseTexture</a></li><li><a href="PIXI.CanvasBuffer.html">PIXI.CanvasBuffer</a></li><li><a href="PIXI.CanvasGraphics.html">PIXI.CanvasGraphics</a></li><li><a href="PIXI.CanvasMaskManager.html">PIXI.CanvasMaskManager</a></li><li><a href="PIXI.CanvasRenderer.html">PIXI.CanvasRenderer</a></li><li><a href="PIXI.CanvasTinter.html">PIXI.CanvasTinter</a></li><li><a href="PIXI.ComplexPrimitiveShader.html">PIXI.ComplexPrimitiveShader</a></li><li><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></li><li><a href="PIXI.DisplayObjectContainer.html">PIXI.DisplayObjectContainer</a></li><li><a href="PIXI.FilterTexture.html">PIXI.FilterTexture</a></li><li><a href="PIXI.PixiFastShader.html">PIXI.PixiFastShader</a></li><li><a href="PIXI.PixiShader.html">PIXI.PixiShader</a></li><li><a href="PIXI.PrimitiveShader.html">PIXI.PrimitiveShader</a></li><li><a href="PIXI.Sprite.html">PIXI.Sprite</a></li><li><a href="PIXI.StripShader.html">PIXI.StripShader</a></li><li><a href="PIXI.Texture.html">PIXI.Texture</a></li><li><a href="PIXI.WebGLBlendModeManager.html">PIXI.WebGLBlendModeManager</a></li><li><a href="PIXI.WebGLFastSpriteBatch.html">PIXI.WebGLFastSpriteBatch</a></li><li><a href="PIXI.WebGLFilterManager.html">PIXI.WebGLFilterManager</a></li><li><a href="PIXI.WebGLRenderer.html">PIXI.WebGLRenderer</a></li>
  				</ul>
  			</li>
  			
  			<li class="dropdown">
  				<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
  				<ul class="dropdown-menu ">
  					<li><a href="global.html">Global</a></li>
  				</ul>
  			</li>
  			
        <li>
  <a href="https://github.com/photonstorm/phaser-ce/blob/master/README.md">
    <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
    README
  </a>
</li>

<li>
  <a href="https://github.com/photonstorm/phaser-ce/blob/master/CHANGELOG.md">
    <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
    CHANGELOG
  </a>
</li>

<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
    <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
    Community
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <li>
      <a href="http://phaser.io">Phaser</a>
    </li>
    <li>
      <a href="https://github.com/photonstorm/phaser-ce">Phaser CE on GitHub</a>
    </li>
    <li>
      <a href="https://codepen.io/collection/AMbZgY/">Phaser CE Examples</a>
    </li>
    <li>
      <a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a>
    </li>
    <li>
      <a href="https://twitter.com/photonstorm">Twitter</a>
    </li>
    <li>
      <a href="http://phaser.io/community/slack">Slack</a>
    </li>
    <li>
      <a href="http://phaser.io/community/donate">Donate</a>
    </li>
  </ul>
</li>

  		</ul>
          
  	</div>
  </div>
</div>


<div class="container-fluid" id="toc-content">
	<div class="row">
		
	  <div class="col-md-9 col-md-offset-3">
		
			<div id="main">

	<h1 class="page-title">Class: Weapon</h1>
<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="Phaser.html">Phaser</a>.</span>
        
        Weapon
        </h2>
        
    
</header>


<article>
    <div class="container-overview">
    
        
<dt>
    <h4 class="name" id="Weapon" data-name="Weapon">
      <span class="type-signature"></span>new Weapon(game, parent)
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>The Weapon Plugin provides the ability to easily create a bullet pool and manager.</p>
<p>Weapons fire <a href="Phaser.Bullet.html">Phaser.Bullet</a> objects, which are essentially Sprites with a few extra properties.
The Bullets are enabled for <a href="Phaser.Physics.Arcade.html">Arcade Physics</a>. They do not currently work with P2 Physics.</p>
<p>The Bullets are created inside of weapon.bullets, which is a <a href="Phaser.Group.html">Phaser.Group</a> instance. Anything you
can usually do with a Group, such as move it around the display list, iterate it, etc can be done
to the bullets Group too.</p>
<p>Bullets can have textures and even animations. You can control the speed at which they are fired,
the firing rate, the firing angle, and even set things like gravity for them.</p>
<p>A small example, using <a href="Phaser.GameObjectFactory.html#weapon">add.weapon</a>, assumed to be running from within a <a href="Phaser.State.html#create">Phaser.State#create</a> method:</p>
<pre class="prettyprint source lang-javascript"><code>var weapon = this.add.weapon(10, 'bullet');
weapon.fireFrom.set(300, 300);
this.input.onDown.add(weapon.fire, this);
</code></pre>
<p>If you want to (re)create the bullet pool separately, you can use:</p>
<pre class="prettyprint source lang-javascript"><code>var weapon = this.game.plugins.add(Phaser.Weapon);
// …
weapon.createBullets(10, 'bullet');
</code></pre>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>game</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Game.html">Phaser.Game</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>A reference to the current Phaser.Game instance.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>parent</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.PluginManager.html">Phaser.PluginManager</a></span>



            
            </td>

            

            

            <td class="description param-description last"><p>The Phaser Plugin Manager which looks after this plugin.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L41" title="Weapon on line 41 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 41</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

    
    </div>

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        <dl>
            
<dt>
    <h4 id=".KILL_CAMERA_BOUNDS" data-name="KILL_CAMERA_BOUNDS">
      <span class="type-signature">&lt;static, constant> </span>KILL_CAMERA_BOUNDS<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets when they leave the <a href="Phaser.Camera.html#bounds">Phaser.Camera#bounds</a> rectangle.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L477" title="KILL_CAMERA_BOUNDS on line 477 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 477</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_DISTANCE" data-name="KILL_DISTANCE">
      <span class="type-signature">&lt;static, constant> </span>KILL_DISTANCE<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets after they
exceed the <a href="Phaser.Weapon.html#bulletKillDistance">bulletKillDistance</a> from their original firing position.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L463" title="KILL_DISTANCE on line 463 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 463</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_LIFESPAN" data-name="KILL_LIFESPAN">
      <span class="type-signature">&lt;static, constant> </span>KILL_LIFESPAN<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets when their <a href="Phaser.Weapon.html#bulletLifespan">bulletLifespan</a> expires.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L455" title="KILL_LIFESPAN on line 455 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 455</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_NEVER" data-name="KILL_NEVER">
      <span class="type-signature">&lt;static, constant> </span>KILL_NEVER<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that stops the bullets from ever being destroyed automatically.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L448" title="KILL_NEVER on line 448 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 448</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_STATIC_BOUNDS" data-name="KILL_STATIC_BOUNDS">
      <span class="type-signature">&lt;static, constant> </span>KILL_STATIC_BOUNDS<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets when they leave the <a href="Phaser.Weapon.html#bounds">bounds</a> rectangle.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L491" title="KILL_STATIC_BOUNDS on line 491 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 491</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_WEAPON_BOUNDS" data-name="KILL_WEAPON_BOUNDS">
      <span class="type-signature">&lt;static, constant> </span>KILL_WEAPON_BOUNDS<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets when they leave the <a href="Phaser.Weapon.html#bounds">bounds</a> rectangle.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L470" title="KILL_WEAPON_BOUNDS on line 470 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 470</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id=".KILL_WORLD_BOUNDS" data-name="KILL_WORLD_BOUNDS">
      <span class="type-signature">&lt;static, constant> </span>KILL_WORLD_BOUNDS<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>A <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> constant that automatically kills the bullets when they leave the <a href="Phaser.World.html#bounds">Phaser.World#bounds</a> rectangle.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L484" title="KILL_WORLD_BOUNDS on line 484 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 484</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="_hasFired" data-name="_hasFired">
      <span class="type-signature"></span>_hasFired<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Internal multiFire test flag.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L392" title="_hasFired on line 392 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 392</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="autoExpandBulletsGroup" data-name="autoExpandBulletsGroup">
      <span class="type-signature"></span>autoExpandBulletsGroup<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Should the bullet pool run out of bullets (i.e. they are all in flight) then this
boolean controls if the Group will create a brand new bullet object or not.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L58" title="autoExpandBulletsGroup on line 58 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 58</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="autofire" data-name="autofire">
      <span class="type-signature"></span>autofire<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Will this weapon auto fire? If set to true then a new bullet will be fired
based on the <a href="Phaser.Weapon.html#fireRate">fireRate</a> value.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L66" title="autofire on line 66 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 66</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bounds" data-name="bounds">
      <span class="type-signature"></span>bounds<span class="type-signature"> : <a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This Rectangle defines the bounds that are used when determining if a Bullet should be killed or not.
It's used in combination with <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> when that is set to either <code>Phaser.Weapon.KILL_WEAPON_BOUNDS</code>
or <code>Phaser.Weapon.KILL_STATIC_BOUNDS</code>. If you are not using either of these kill types then the bounds are ignored.
If you are tracking a Sprite or Point then the bounds are centered on that object every frame.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L298" title="bounds on line 298 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 298</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletAngleOffset" data-name="bulletAngleOffset">
      <span class="type-signature"></span>bulletAngleOffset<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>An optional angle offset applied to the Bullets when they are launched.
This is useful if for example your bullet sprites have been drawn facing up, instead of
to the right, and you want to fire them at an angle. In which case you can set the
angle offset to be 90 and they'll be properly rotated when fired.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L178" title="bulletAngleOffset on line 178 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 178</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletAngleVariance" data-name="bulletAngleVariance">
      <span class="type-signature"></span>bulletAngleVariance<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is a variance added to the angle of Bullets when they are fired.
If you fire from an angle of 90 and have a <code>bulletAngleVariance</code> of 20 then the actual
angle of the Bullets will be between 70 and 110 degrees. This is a quick way to add a
great 'spread' effect to a Weapon.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L188" title="bulletAngleVariance on line 188 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 188</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletAnimation" data-name="bulletAnimation">
      <span class="type-signature"></span>bulletAnimation<span class="type-signature"> : string</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The string based name of the animation that the Bullet will be given on launch.
This is set via <a href="Phaser.Weapon.html#addBulletAnimation">addBulletAnimation</a>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">string</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L132" title="bulletAnimation on line 132 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 132</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletClass" data-name="bulletClass">
      <span class="type-signature"></span>bulletClass<span class="type-signature"> : function</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Class of the bullets that are launched by this Weapon. Defaults to <a href="Phaser.Bullet.html">Phaser.Bullet</a>, but can be
overridden before calling <code>createBullets</code> and set to your own class type.</p>
<p>It should be a constructor function accepting <code>(game, x, y, key, frame)</code>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">function</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1333" title="bulletClass on line 1333 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1333</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletCollideWorldBounds" data-name="bulletCollideWorldBounds">
      <span class="type-signature"></span>bulletCollideWorldBounds<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Should bullets collide with the World bounds or not?</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1430" title="bulletCollideWorldBounds on line 1430 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1430</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletFrame" data-name="bulletFrame">
      <span class="type-signature"></span>bulletFrame<span class="type-signature"> : string | integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Texture Frame that the Bullets use when rendering.
Changing this has no effect on bullets in-flight, only on newly spawned bullets.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">string</span>
|

<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L253" title="bulletFrame on line 253 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 253</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletFrameCycle" data-name="bulletFrameCycle">
      <span class="type-signature"></span>bulletFrameCycle<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If you've added a set of frames via <a href="Phaser.Weapon.html#setBulletFrames">setBulletFrames</a> then you can optionally
chose for each Bullet fired to use the next frame in the set. The frame index is then
advanced one frame until it reaches the end of the set, then it starts from the start
again. Cycling frames like this allows you to create varied bullet effects via
sprite sheets.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L151" title="bulletFrameCycle on line 151 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 151</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletFrameRandom" data-name="bulletFrameRandom">
      <span class="type-signature"></span>bulletFrameRandom<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If you've added a set of frames via <a href="Phaser.Weapon.html#setBulletFrames">setBulletFrames</a> then you can optionally
chose for each Bullet fired to pick a random frame from the set.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L140" title="bulletFrameRandom on line 140 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 140</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletFrames" data-name="bulletFrames">
      <span class="type-signature">&lt;protected> </span>bulletFrames<span class="type-signature"> : Array</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This array stores the frames added via @link #setBulletFrames.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">Array</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L314" title="bulletFrames on line 314 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 314</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletGravity" data-name="bulletGravity">
      <span class="type-signature"></span>bulletGravity<span class="type-signature"> : <a href="Phaser.Point.html">Phaser.Point</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is the amount of <a href="Phaser.Physics.Arcade.Body.html#gravity">Phaser.Physics.Arcade.Body#gravity</a> added to the Bullets physics body when fired.
Gravity is expressed in pixels / second / second.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L228" title="bulletGravity on line 228 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 228</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletInheritSpriteSpeed" data-name="bulletInheritSpriteSpeed">
      <span class="type-signature"></span>bulletInheritSpriteSpeed<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>When a Bullet is fired it can optionally inherit the velocity of the <code>trackedSprite</code> if set.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L124" title="bulletInheritSpriteSpeed on line 124 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 124</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletKey" data-name="bulletKey">
      <span class="type-signature"></span>bulletKey<span class="type-signature"> : string</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Texture Key that the Bullets use when rendering.
Changing this has no effect on bullets in-flight, only on newly spawned bullets.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">string</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L245" title="bulletKey on line 245 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 245</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletKillDistance" data-name="bulletKillDistance">
      <span class="type-signature"></span>bulletKillDistance<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If you've set <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> to <code>Phaser.Weapon.KILL_DISTANCE</code> this controls the distance
the Bullet can travel before it is automatically killed. The distance is given in pixels.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L221" title="bulletKillDistance on line 221 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 221</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletKillType" data-name="bulletKillType">
      <span class="type-signature"></span>bulletKillType<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This controls how the bullets will be killed. The default is <code>Phaser.Weapon.KILL_WORLD_BOUNDS</code>.</p>
<p>There are 7 different &quot;kill types&quot; available:</p>
<ul>
<li>
<p><code>Phaser.Weapon.KILL_NEVER</code>
The bullets are never destroyed by the Weapon. It's up to you to destroy them via your own code.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_LIFESPAN</code>
The bullets are automatically killed when their <a href="Phaser.Weapon.html#bulletLifespan">bulletLifespan</a> amount expires.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_DISTANCE</code>
The bullets are automatically killed when they exceed <a href="Phaser.Weapon.html#bulletKillDistance">bulletKillDistance</a> pixels away from their original launch position.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_WEAPON_BOUNDS</code>
The bullets are automatically killed when they no longer intersect with the <a href="Phaser.Weapon.html#bounds">bounds</a> rectangle.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_CAMERA_BOUNDS</code>
The bullets are automatically killed when they no longer intersect with the <a href="Phaser.Camera.html#bounds">Phaser.Camera#bounds</a> rectangle.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_WORLD_BOUNDS</code>
The bullets are automatically killed when they no longer intersect with the <a href="Phaser.World.html#bounds">Phaser.World#bounds</a> rectangle.</p>
</li>
<li>
<p><code>Phaser.Weapon.KILL_STATIC_BOUNDS</code>
The bullets are automatically killed when they no longer intersect with the <a href="Phaser.Weapon.html#bounds">bounds</a> rectangle.
The difference between static bounds and weapon bounds, is that a static bounds will never be adjusted to
match the position of a tracked sprite or pointer.</p>
</li>
</ul>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1365" title="bulletKillType on line 1365 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1365</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletLifespan" data-name="bulletLifespan">
      <span class="type-signature"></span>bulletLifespan<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If you've set <a href="Phaser.Weapon.html#bulletKillType">bulletKillType</a> to <code>Phaser.Weapon.KILL_LIFESPAN</code> this controls the amount
of lifespan the Bullets have set on launch. The value is given in milliseconds.
When a Bullet hits its lifespan limit it will be automatically killed.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L213" title="bulletLifespan on line 213 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 213</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletRotateToVelocity" data-name="bulletRotateToVelocity">
      <span class="type-signature"></span>bulletRotateToVelocity<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Bullets can optionally adjust their rotation in-flight to match their velocity.
This can create the effect of a bullet 'pointing' to the path it is following, for example
an arrow being fired from a bow, and works especially well when added to <a href="Phaser.Weapon.html#bulletGravity">bulletGravity</a>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L237" title="bulletRotateToVelocity on line 237 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 237</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bullets" data-name="bullets">
      <span class="type-signature"></span>bullets<span class="type-signature"> : <a href="Phaser.Group.html">Phaser.Group</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is the Phaser.Group that contains all of the bullets managed by this plugin.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L50" title="bullets on line 50 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 50</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletSpeed" data-name="bulletSpeed">
      <span class="type-signature"></span>bulletSpeed<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The initial velocity of fired bullets, in pixels per second.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	
	<dt class="tag-default method-doc-label method-doc-details-label">Default Value:</dt>
	<dd class="tag-default">
		<ul class="dummy">
			<li>200</li>
		</ul>
	</dd>
	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L195" title="bulletSpeed on line 195 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 195</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletSpeedVariance" data-name="bulletSpeedVariance">
      <span class="type-signature"></span>bulletSpeedVariance<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is a variance added to the speed of Bullets when they are fired.
If bullets have a <a href="Phaser.Weapon.html#bulletSpeed">bulletSpeed</a> value of 200, and a <code>bulletSpeedVariance</code> of 50
then the actual speed of the Bullets will be between 150 and 250 pixels per second.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L204" title="bulletSpeedVariance on line 204 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 204</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletWorldWrap" data-name="bulletWorldWrap">
      <span class="type-signature"></span>bulletWorldWrap<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>Should the Bullets wrap around the world bounds? This automatically calls
<code>World.wrap</code> on the Bullet each frame. See the docs for that method for details.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L159" title="bulletWorldWrap on line 159 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 159</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="bulletWorldWrapPadding" data-name="bulletWorldWrapPadding">
      <span class="type-signature"></span>bulletWorldWrapPadding<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If <code>bulletWorldWrap</code> is true then you can provide an optional padding value with this
property. It's added to the calculations determining when the Bullet should wrap around
the world or not. The value is given in pixels.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L168" title="bulletWorldWrapPadding on line 168 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 168</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="fireAngle" data-name="fireAngle">
      <span class="type-signature"></span>fireAngle<span class="type-signature"> : integer</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The angle at which the bullets are fired. This can be a const such as Phaser.ANGLE_UP
or it can be any number from 0 to 360 inclusive, where 0 degrees is to the right.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">integer</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L117" title="fireAngle on line 117 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 117</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="fireFrom" data-name="fireFrom">
      <span class="type-signature"></span>fireFrom<span class="type-signature"> : <a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is a Rectangle from within which the bullets are fired. By default it's a 1x1
rectangle, the equivalent of a Point. But you can change the width and height, and if
larger than 1x1 it'll pick a random point within the rectangle to launch the bullet from.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L109" title="fireFrom on line 109 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 109</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="fireLimit" data-name="fireLimit">
      <span class="type-signature"></span>fireLimit<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The maximum number of shots that this Weapon is allowed to fire before it stops.
When the limit is his the <a href="Phaser.Weapon.html#onFireLimit">onFireLimit</a> Signal is dispatched.
You can reset the shot counter via <a href="Phaser.Weapon.html#resetShots">resetShots</a>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L84" title="fireLimit on line 84 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 84</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="fireRate" data-name="fireRate">
      <span class="type-signature"></span>fireRate<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The minimum interval between shots, in milliseconds.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	
	<dt class="tag-default method-doc-label method-doc-details-label">Default Value:</dt>
	<dd class="tag-default">
		<ul class="dummy">
			<li>100</li>
		</ul>
	</dd>
	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L91" title="fireRate on line 91 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 91</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="fireRateVariance" data-name="fireRateVariance">
      <span class="type-signature"></span>fireRateVariance<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>This is a modifier that is added to the <a href="Phaser.Weapon.html#fireRate">fireRate</a> each update to add variety
to the firing rate of the Weapon. The value is given in milliseconds.
If you've a <code>fireRate</code> of 200 and a <code>fireRateVariance</code> of 50 then the actual
firing rate of the Weapon will be between 150 and 250.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L101" title="fireRateVariance on line 101 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 101</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="multiFire" data-name="multiFire">
      <span class="type-signature"></span>multiFire<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If you want this Weapon to be able to fire more than 1 bullet in a single
update, then set this property to <code>true</code>. When <code>true</code> the Weapon plugin won't
set the shot / firing timers until the <code>postRender</code> phase of the game loop.
This means you can call <code>fire</code> (and similar methods) as often as you like in one
single game update.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L385" title="multiFire on line 385 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 385</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onFire" data-name="onFire">
      <span class="type-signature"></span>onFire<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The onFire Signal is dispatched each time <a href="Phaser.Weapon.html#fire">fire</a> is called, and a Bullet is
<em>successfully</em> launched. The callback is set two arguments: a reference to the bullet sprite itself,
and a reference to the Weapon that fired the bullet.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L338" title="onFire on line 338 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 338</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onFireLimit" data-name="onFireLimit">
      <span class="type-signature"></span>onFireLimit<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The onFireLimit Signal is dispatched if <a href="Phaser.Weapon.html#fireLimit">fireLimit</a> is &gt; 0, and a bullet launch takes the number
of shots fired to equal the fire limit.
The callback is sent two arguments: A reference to this Weapon, and the value of
<a href="Phaser.Weapon.html#fireLimit">fireLimit</a>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L357" title="onFireLimit on line 357 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 357</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="onKill" data-name="onKill">
      <span class="type-signature"></span>onKill<span class="type-signature"> : <a href="Phaser.Signal.html">Phaser.Signal</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The onKill Signal is dispatched each time a Bullet that is in-flight is killed. This can be the result
of leaving the Weapon bounds, an expiring lifespan, or exceeding a specified distance.
The callback is sent one argument: A reference to the bullet sprite itself.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Signal.html">Phaser.Signal</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L347" title="onKill on line 347 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 347</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="shots" data-name="shots">
      <span class="type-signature"></span>shots<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The total number of bullets this Weapon has fired so far.
You can limit the number of shots allowed (via <a href="Phaser.Weapon.html#fireLimit">fireLimit</a>), and reset
this total via <a href="Phaser.Weapon.html#resetShots">resetShots</a>.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L75" title="shots on line 75 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 75</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="trackedPointer" data-name="trackedPointer">
      <span class="type-signature"></span>trackedPointer<span class="type-signature"> : <a href="Phaser.Pointer.html">Phaser.Pointer</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Pointer currently being tracked by the Weapon, if any.
This is set via the <a href="Phaser.Weapon.html#trackPointer">trackPointer</a> method.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Pointer.html">Phaser.Pointer</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L373" title="trackedPointer on line 373 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 373</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="trackedSprite" data-name="trackedSprite">
      <span class="type-signature"></span>trackedSprite<span class="type-signature"> : <a href="Phaser.Sprite.html">Phaser.Sprite</a> | Object</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Sprite currently being tracked by the Weapon, if any.
This is set via the <a href="Phaser.Weapon.html#trackSprite">trackSprite</a> method.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type">Object</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L365" title="trackedSprite on line 365 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 365</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="trackOffset" data-name="trackOffset">
      <span class="type-signature"></span>trackOffset<span class="type-signature"> : <a href="Phaser.Point.html">Phaser.Point</a></span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The Track Offset is a Point object that allows you to specify a pixel offset that bullets use
when launching from a tracked Sprite or Pointer. For example if you've got a bullet that is 2x2 pixels
in size, but you're tracking a Sprite that is 32x32, then you can set <code>trackOffset.x = 16</code> to have
the bullet launched from the center of the Sprite.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L412" title="trackOffset on line 412 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 412</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="trackRotation" data-name="trackRotation">
      <span class="type-signature"></span>trackRotation<span class="type-signature"> : boolean</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>If the Weapon is tracking a Sprite, should it also track the Sprites rotation?
This is useful for a game such as Asteroids, where you want the weapon to fire based
on the sprites rotation.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">boolean</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L402" title="trackRotation on line 402 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 402</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="x" data-name="x">
      <span class="type-signature"></span>x<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The x coordinate from which bullets are fired. This is the same as <code>Weapon.fireFrom.x</code>, and
can be overridden by the <a href="Phaser.Weapon.html#fire">fire</a> arguments.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1457" title="x on line 1457 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1457</a>
    

	

	

	
</dl>


    
</dd>

        
            
<dt>
    <h4 id="y" data-name="y">
      <span class="type-signature"></span>y<span class="type-signature"> : number</span>
      
    </h4>
    
</dt>
<dd>
    
    <div class="description members-description">
        <p>The y coordinate from which bullets are fired. This is the same as <code>Weapon.fireFrom.y</code>, and
can be overridden by the <a href="Phaser.Weapon.html#fire">fire</a> arguments.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">number</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1481" title="y on line 1481 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1481</a>
    

	

	

	
</dl>


    
</dd>

        </dl>
    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            
<dt>
    <h4 class="name" id="addBulletAnimation" data-name="addBulletAnimation">
      <span class="type-signature"></span>addBulletAnimation(name [, frames] [, frameRate] [, loop] [, useNumericIndex])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Adds a new animation under the given key. Optionally set the frames, frame rate and loop.
The arguments are all the same as for <code>Animation.add</code>, and work in the same way.</p>
<p><a href="Phaser.Weapon.html#bulletAnimation">bulletAnimation</a> will be set to this animation after it's created. From that point on, all
bullets fired will play using this animation. You can swap between animations by calling this method
several times, and then just changing the <a href="Phaser.Weapon.html#bulletAnimation">bulletAnimation</a> property to the name of the animation
you wish to play for the next launched bullet.</p>
<p>If you wish to stop using animations at all, set <a href="Phaser.Weapon.html#bulletAnimation">bulletAnimation</a> to '' (an empty string).</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The unique (within the Weapon instance) name for the animation, i.e. &quot;fire&quot;, &quot;blast&quot;.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>frames</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    null
                
                </td>
            

            <td class="description param-description last"><p>An array of numbers/strings that correspond to the frames to add to this animation and in which order. e.g. [1, 2, 3] or ['run0', 'run1', run2]). If null then all frames will be used.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>frameRate</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    60
                
                </td>
            

            <td class="description param-description last"><p>The speed at which the animation should play. The speed is given in frames per second.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>loop</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Whether or not the animation is looped or just plays once.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>useNumericIndex</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>Are the given frames using numeric indexes (default) or strings?</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1268" title="addBulletAnimation on line 1268 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1268</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Weapon Plugin.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="createBullets" data-name="createBullets">
      <span class="type-signature"></span>createBullets( [quantity] [, key] [, frame] [, group])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>This method performs two actions: First it will check to see if the <a href="Phaser.Weapon.html#bullets">bullets</a> Group exists or not,
and if not it creates it, adding it the <code>group</code> given as the 4th argument.</p>
<p>Then it will seed the bullet pool with the <code>quantity</code> number of Bullets, using the texture key and frame
provided (if any).</p>
<p>If for example you set the quantity to be 10, then this Weapon will only ever be able to have 10 bullets
in-flight simultaneously. If you try to fire an 11th bullet then nothing will happen until one, or more, of
the in-flight bullets have been killed, freeing them up for use by the Weapon again.</p>
<p>If you do not wish to have a limit set, then pass in -1 as the quantity. In this instance the Weapon will
keep increasing the size of the bullet pool as needed. It will never reduce the size of the pool however,
so be careful it doesn't grow too large.</p>
<p>You can either set the texture key and frame here, or via the <a href="Phaser.Weapon.html#bulletKey">bulletKey</a> and <a href="Phaser.Weapon.html#bulletFrame">bulletFrame</a>
properties. You can also animate bullets, or set them to use random frames. All Bullets belonging to a
single Weapon instance must share the same texture key however.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>quantity</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    1
                
                </td>
            

            <td class="description param-description last"><p>The quantity of bullets to seed the Weapon with. If -1 it will set the pool to automatically expand.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The Game.cache key of the image that this Sprite will use.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>frame</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>
|

<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>If the Sprite image contains multiple frames you can specify which one to use here.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>group</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Optional Group to add the object to. If not specified it will be added to the World group.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L493" title="createBullets on line 493 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 493</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="debug" data-name="debug">
      <span class="type-signature"></span>debug( [x] [, y] [, debugBodies])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Uses <code>Game.Debug</code> to draw some useful information about this Weapon, including the number of bullets
both in-flight, and available. And optionally the physics debug bodies of the bullets.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    16
                
                </td>
            

            <td class="description param-description last"><p>The coordinate, in screen space, at which to draw the Weapon debug data.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    32
                
                </td>
            

            <td class="description param-description last"><p>The coordinate, in screen space, at which to draw the Weapon debug data.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>debugBodies</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Optionally draw the physics body of every bullet in-flight.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1307" title="debug on line 1307 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1307</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="destroy" data-name="destroy">
      <span class="type-signature"></span>destroy()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Destroys this Weapon. It removes itself from the PluginManager, destroys
the <a href="Phaser.Weapon.html#bullets">bullets</a> Group, and nulls internal references.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L650" title="destroy on line 650 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 650</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="fire" data-name="fire">
      <span class="type-signature"></span>fire( [from] [, x] [, y] [, offsetX] [, offsetY])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Attempts to fire a single Bullet. If there are no more bullets available in the pool, and the pool cannot be extended,
then this method returns <code>null</code>. It will also return <code>null</code> if not enough time has expired since the last time
the Weapon was fired, as defined in the <a href="Phaser.Weapon.html#fireRate">fireRate</a> property.</p>
<p>Otherwise the first available bullet is selected, launched, and returned.</p>
<p>The arguments are all optional, but allow you to control both where the bullet is launched from, and aimed at.</p>
<p>If you don't provide any of the arguments then it uses those set via properties such as <a href="Phaser.Weapon.html#trackedSprite">trackedSprite</a>,
bulletAngle and so on.</p>
<p>When the bullet is launched it has its texture and frame updated, as required. The velocity of the bullet is
calculated based on Weapon properties like <code>bulletSpeed</code>.</p>
<p>If you wish to fire multiple bullets in a single game update, then set <code>Weapon.multiFire = true</code>
and you can call <code>fire</code> as many times as you like, per loop. Multiple fires in a single update
only counts once towards the <code>shots</code> total, but you will still receive a Signal for each bullet.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>from</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>
|

<span class="param-type">Object</span>
|

<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>Optionally fires the bullet <strong>from</strong> the <code>x</code> and <code>y</code> properties of this object. If set this overrides #trackedSprite or <code>trackedPointer</code>. Pass <code>null</code> to ignore it.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The x coordinate, in world space, to fire the bullet <strong>towards</strong>. If left as <code>undefined</code>, or <code>null</code>, the bullet direction is based on its angle.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The y coordinate, in world space, to fire the bullet <strong>towards</strong>. If left as <code>undefined</code>, or <code>null</code>, the bullet direction is based on its angle.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetX</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>If the bullet is fired from a tracked Sprite or Pointer, or the <code>from</code> argument is set, this applies a horizontal offset from the launch position.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetY</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>If the bullet is fired from a tracked Sprite or Pointer, or the <code>from</code> argument is set, this applies a vertical offset from the launch position.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L871" title="fire on line 871 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 871</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The fired bullet, if a launch was successful, otherwise <code>null</code>.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Bullet.html">Phaser.Bullet</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="fireAtPointer" data-name="fireAtPointer">
      <span class="type-signature"></span>fireAtPointer( [pointer])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Fires a bullet <strong>at</strong> the given Pointer. The bullet will be launched from the <a href="Phaser.Weapon.html#fireFrom">fireFrom</a> position,
or from a Tracked Sprite or Pointer, if you have one set.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>pointer</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Pointer.html">Phaser.Pointer</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The Pointer to fire the bullet towards.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1143" title="fireAtPointer on line 1143 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1143</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The fired bullet if successful, null otherwise.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Bullet.html">Phaser.Bullet</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="fireAtSprite" data-name="fireAtSprite">
      <span class="type-signature"></span>fireAtSprite( [sprite])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Fires a bullet <strong>at</strong> the given Sprite. The bullet will be launched from the <a href="Phaser.Weapon.html#fireFrom">fireFrom</a> position,
or from a Tracked Sprite or Pointer, if you have one set.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>sprite</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The Sprite to fire the bullet towards.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1160" title="fireAtSprite on line 1160 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1160</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The fired bullet if successful, null otherwise.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Bullet.html">Phaser.Bullet</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="fireAtXY" data-name="fireAtXY">
      <span class="type-signature"></span>fireAtXY( [x] [, y])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Fires a bullet <strong>at</strong> the given coordinates. The bullet will be launched from the <a href="Phaser.Weapon.html#fireFrom">fireFrom</a> position,
or from a Tracked Sprite or Pointer, if you have one set.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>x</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The x coordinate, in world space, to fire the bullet towards.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>y</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The y coordinate, in world space, to fire the bullet towards.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1175" title="fireAtXY on line 1175 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1175</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The fired bullet if successful, null otherwise.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Bullet.html">Phaser.Bullet</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="fireMany" data-name="fireMany">
      <span class="type-signature"></span>fireMany(positions [, from])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Attempts to fire multiple bullets from the positions defined in the given array.</p>
<p>If you provide a <code>from</code> argument, or if there is a tracked Sprite or Pointer, then
the positions are treated as <strong>offsets</strong> from the given objects position.</p>
<p>If <code>from</code> is undefined, and there is no tracked object, then the bullets are fired
from the given positions, as they exist in the world.</p>
<p>Calling this method sets <a href="Phaser.Weapon.html#multiFire">multiFire</a> to <code>true</code>.</p>
<p>If there are not enough bullets available in the pool, and the pool cannot be extended,
then this method may not fire from all of the given positions.</p>
<p>When the bullets are launched they have their texture and frame updated, as required.
The velocity of the bullets are calculated based on Weapon properties like <a href="Phaser.Weapon.html#bulletSpeed">bulletSpeed</a>.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>positions</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>An array of positions. Each position can be any Object, as long as it has public <code>x</code> and <code>y</code> properties, such as Phaser.Point, { x: 0, y: 0 }, Phaser.Sprite, etc.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>from</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>
|

<span class="param-type">Object</span>
|

<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Optionally fires the bullets <strong>from</strong> the <code>x</code> and <code>y</code> properties of this object, <em>instead</em> of any #trackedSprite or <code>trackedPointer</code> that is set.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L786" title="fireMany on line 786 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 786</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>An array containing all of the fired Phaser.Bullet objects, if a launch was successful, otherwise an empty array.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">array</span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="fireOffset" data-name="fireOffset">
      <span class="type-signature"></span>fireOffset( [offsetX] [, offsetY])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Attempts to fire a single Bullet from a tracked Sprite or Pointer, but applies an offset
to the position first. This is the same as calling <a href="Phaser.Weapon.html#fire">fire</a> and passing in the offset arguments.</p>
<p>If there are no more bullets available in the pool, and the pool cannot be extended,
then this method returns <code>null</code>. It will also return <code>null</code> if not enough time has expired since the last time
the Weapon was fired, as defined in the <a href="Phaser.Weapon.html#fireRate">fireRate</a> property.</p>
<p>Otherwise the first available bullet is selected, launched, and returned.</p>
<p>When the bullet is launched it has its texture and frame updated, as required. The velocity of the bullet is
calculated based on Weapon properties like <a href="Phaser.Weapon.html#bulletSpeed">bulletSpeed</a>.</p>
<p>If you wish to fire multiple bullets in a single game update, then set <a href="Phaser.Weapon.html#multiFire">multiFire</a> to <code>true</code>
and you can call this method as many times as you like, per loop. See also <a href="Phaser.Weapon.html#fireMany">fireMany</a>.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>offsetX</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The horizontal offset from the position of the tracked Sprite or Pointer, as set with #trackSprite.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetY</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The vertical offset from the position of the tracked Sprite or Pointer, as set with #trackSprite.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L840" title="fireOffset on line 840 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 840</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The fired bullet, if a launch was successful, otherwise <code>null</code>.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Bullet.html">Phaser.Bullet</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="forEach" data-name="forEach">
      <span class="type-signature"></span>forEach(callback, callbackContext [, args])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Call a function on each in-flight bullet in this Weapon.</p>
<p>See <a href="Phaser.Group.html#forEachExists">forEachExists</a> for more details.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The function that will be called for each applicable child. The child will be passed as the first argument.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callbackContext</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The context in which the function should be called (usually 'this').</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>args</code></td>
            

            <td class="type">
            
                
<span class="param-type">any</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                    &lt;repeatable><br>
                
                </td>
            

            
                <td class="default">
                
                    (none)
                
                </td>
            

            <td class="description param-description last"><p>Additional arguments to pass to the callback function, after the child item.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L556" title="forEach on line 556 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 556</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="killAll" data-name="killAll">
      <span class="type-signature"></span>killAll()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Calls <a href="Phaser.Bullet.html#kill">Phaser.Bullet#kill</a> on every in-flight bullet in this Weapon.
Also re-enables their physics bodies, should they have been disabled via <a href="Phaser.Weapon.html#pauseAll">pauseAll</a>.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L610" title="killAll on line 610 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 610</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="pauseAll" data-name="pauseAll">
      <span class="type-signature"></span>pauseAll()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets <a href="Phaser.Physics.Arcade.Body.html#enable">Phaser.Physics.Arcade.Body#enable</a> to <code>false</code> on each bullet in this Weapon.
This has the effect of stopping them in-flight should they be moving.
It also stops them being able to be checked for collision.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L576" title="pauseAll on line 576 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 576</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="postRender" data-name="postRender">
      <span class="type-signature">&lt;protected> </span>postRender()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Internal update method, called by the PluginManager.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L699" title="postRender on line 699 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 699</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        
            
<dt>
    <h4 class="name" id="resetShots" data-name="resetShots">
      <span class="type-signature"></span>resetShots( [newLimit])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Resets the <a href="Phaser.Weapon.html#shots">shots</a> counter back to zero. This is used when you've set
<a href="Phaser.Weapon.html#fireLimit">fireLimit</a> and have hit (or just wish to reset) your limit.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>newLimit</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>Optionally set a new #fireLimit.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L628" title="resetShots on line 628 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 628</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="resumeAll" data-name="resumeAll">
      <span class="type-signature"></span>resumeAll()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets <a href="Phaser.Physics.Arcade.Body.html#enable">Phaser.Physics.Arcade.Body#enable</a> to <code>true</code> on each bullet in this Weapon.
This has the effect of resuming their motion should they be in-flight.
It also enables them for collision checks again.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L593" title="resumeAll on line 593 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 593</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="setBulletBodyOffset" data-name="setBulletBodyOffset">
      <span class="type-signature"></span>setBulletBodyOffset(width, height [, offsetX] [, offsetY])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>You can modify the size of the physics Body the Bullets use to be any dimension you need.
This allows you to make it smaller, or larger, than the parent Sprite.
You can also control the x and y offset of the Body. This is the position of the
Body relative to the top-left of the Sprite <em>texture</em>.</p>
<p>For example: If you have a Sprite with a texture that is 80x100 in size,
and you want the physics body to be 32x32 pixels in the middle of the texture, you would do:</p>
<p><code>setSize(32 / Math.abs(this.scale.x), 32 / Math.abs(this.scale.y), 24, 34)</code></p>
<p>Where the first two parameters are the new Body size (32x32 pixels) relative to the Sprite's scale.
24 is the horizontal offset of the Body from the top-left of the Sprites texture, and 34
is the vertical offset.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>width</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The width of the Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>height</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The height of the Body.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetX</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The X offset of the Body from the top-left of the Sprites texture.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetY</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description param-description last"><p>The Y offset of the Body from the top-left of the Sprites texture.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1191" title="setBulletBodyOffset on line 1191 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1191</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Weapon Plugin.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="setBulletFrames" data-name="setBulletFrames">
      <span class="type-signature"></span>setBulletFrames(min, max [, cycle] [, random])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets the texture frames that the bullets can use when being launched.</p>
<p>This is intended for use when you've got numeric based frames, such as those loaded via a Sprite Sheet.</p>
<p>It works by calling <code>Phaser.ArrayUtils.numberArray</code> internally, using the min and max values
provided. Then it sets the frame index to be zero.</p>
<p>You can optionally set the cycle and random booleans, to allow bullets to cycle through the frames
when they're fired, or pick one at random.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>min</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The minimum value the frame can be. Usually zero.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>max</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The maximum value the frame can be.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cycle</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description param-description last"><p>Should the bullet frames cycle as they are fired?</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>random</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Should the bullet frames be picked at random as they are fired?</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L1233" title="setBulletFrames on line 1233 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 1233</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Weapon Plugin.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="trackPointer" data-name="trackPointer">
      <span class="type-signature"></span>trackPointer( [pointer] [, offsetX] [, offsetY])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets this Weapon to track the given Pointer.
When a Weapon tracks a Pointer it will automatically update its <a href="Phaser.Weapon.html#fireFrom">fireFrom</a> value to match the Pointer's
position within the Game World, adjusting the coordinates based on the offset arguments.</p>
<p>This allows you to lock a Weapon to a Pointer, so that bullets are always launched from its location.</p>
<p>Calling <code>trackPointer</code> will reset <a href="Phaser.Weapon.html#trackedSprite">trackedSprite</a> to null, should it have been set, as you can
only track <em>either</em> a Pointer, or a Sprite, at once, but not both.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>pointer</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Pointer.html">Phaser.Pointer</a></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The Pointer to track the position of. Defaults to <code>Input.activePointer</code> if not specified.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetX</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The horizontal offset from the Pointers position to be applied to the Weapon.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetY</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The vertical offset from the Pointers position to be applied to the Weapon.</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L753" title="trackPointer on line 753 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 753</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="trackSprite" data-name="trackSprite">
      <span class="type-signature"></span>trackSprite(sprite [, offsetX] [, offsetY] [, trackRotation])
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Sets this Weapon to track the given Sprite, or any Object with a public <a href="Phaser.Component.Core.html#world">world</a> Point object.
When a Weapon tracks a Sprite it will automatically update its <a href="Phaser.Weapon.html#fireFrom">fireFrom</a> value to match the Sprite's
position within the Game World, adjusting the coordinates based on the offset arguments.</p>
<p>This allows you to lock a Weapon to a Sprite, so that bullets are always launched from its location.</p>
<p>Calling <code>trackSprite</code> will reset <a href="Phaser.Weapon.html#trackedPointer">trackedPointer</a> to null, should it have been set, as you can
only track <em>either</em> a Sprite, or a Pointer, at once, but not both.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>sprite</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|

<span class="param-type">Object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description param-description last"><p>The Sprite to track the position of.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetX</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The horizontal offset from the Sprites position to be applied to the Weapon.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>offsetY</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description param-description last"><p>The vertical offset from the Sprites position to be applied to the Weapon.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>trackRotation</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description param-description last"><p>Should the Weapon also track the Sprites rotation?</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L719" title="trackSprite on line 719 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 719</a>
    

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>This Weapon instance.</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Phaser.Weapon.html">Phaser.Weapon</a></span>



    </dd>
</dl>


        

    
</dd>

        
            
<dt>
    <h4 class="name" id="update" data-name="update">
      <span class="type-signature">&lt;protected> </span>update()
      
    </h4>
    
</dt>
<dd>

    
    <div class="description method-description">
        <p>Internal update method, called by the PluginManager.</p>
    </div>
    

    

    

    
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
    
      <a href="https://github.com/photonstorm/phaser-ce/blob/v2.16.1/src/plugins/weapon/WeaponPlugin.js#L670" title="update on line 670 of src/plugins/weapon/WeaponPlugin.js">src/plugins/weapon/WeaponPlugin.js line 670</a>
    

	

	

	
</dl>


    

    

    

    

    

    

    
</dd>

        </dl>
    

    

    
</article>

</section>



</div>
	    <footer class="footer">


<p class="package-signature">
  phaser-ce@2.16.1
  is on
  <a href="https://github.com/photonstorm/phaser-ce/releases/tag/v2.16.1">GitHub</a>
  and
  <a href="https://www.npmjs.com/package/phaser-ce">NPM</a>
</p>





	<p class="copyright">
	Phaser Copyright © 2012-2016 Photon Storm Ltd.
	</p>


<p class="jsdoc-message">
	Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a>
	
		on 2020-10-21
	
	using <a href="https://github.com/photonstorm/phaser-ce/tree/master/resources/docstrap-master">Tomorrow</a>.
</p>

</footer>

		</div>
    
      <div class="toc-container hidden-xs hidden-sm">
  <div class="toc-filter">
    <div class="form-inline">
    <div class="form-group">
      <label for="filter" class="control-label">Filter</label>
      <input type="text" class="form-control" id="toc-filter-input">
    </div>
  </div>
  </div>
  <div id="toc">
    <div class="list-group">
      <div id="toc-insert"></div>
    </div>
  </div>
</div>

    
	</div>
</div>

<script defer src="scripts/bundle.js?2020102114"></script>



</body>
</html>